package com.nulgame.bukkit.plugin.responsebuilder;

import com.nulgame.bukkit.plugin.resource.Resource;

public class AntiChatSpamResponseBuilder extends GenericResponseBuilder {
	
	private Integer m_allowedInf;
	private Long m_inMillisTime;
	
	public AntiChatSpamResponseBuilder(String responseFormat, String playerName, 
			String message, Integer allowedInf, Long inSeconTime) {
		super(responseFormat, playerName, message);
		m_allowedInf = allowedInf;
		m_inMillisTime = inSeconTime;
	}
	@Override
	public String toResponse() {
		
		String response = super.toResponse();
		if(response == null){
			return null;
		}
		
		response = response.replaceAll(Resource.ALLOWED_INFRACTION, m_allowedInf.toString());
		response = response.replaceAll(Resource.IN_MILLIS_TIME, m_inMillisTime.toString());
		return response;
	}

}
